package com.lyn.base;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.viewbinding.ViewBinding;

import com.lyn.R;

/**
 * @author longyn 2023/10/10
 * @version 1.0.0
 */
public abstract class BaseDialog <V extends ViewBinding> extends Dialog {

    public V binding;


    public BaseDialog(@NonNull Context context) {
        super(context, R.style.common_dialog);
    }

    public BaseDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
    }

    protected BaseDialog(@NonNull Context context, boolean cancelable, @Nullable OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.binding = getViewBinging();
        setContentView(this.binding.getRoot());
    }

    public abstract V getViewBinging();

}
